package com.yifeng.repo.endpoint.security.console.api.dto;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;

/**
 * Created by daibing on 2023/8/23.
 */
@Data
@AllArgsConstructor
public class AccountDto {
    private String code;
    private String name;
    private Long exp;

    public AccountDto(String code, String name) {
        this.code = code;
        this.name = name;
        this.exp = LocalDateTime.of(LocalDate.now().plusDays(7), LocalTime.of(6, 0))
                .atZone(ZoneId.systemDefault())
                .toEpochSecond();
    }
}
